from flask import Blueprint, request, jsonify
from app import db
from app.models.table import Table

detailTables_bp = Blueprint('detailTable', __name__, url_prefix='/detailTable')

# 通过id去查找tableContent
@detailTables_bp.route('/<string:mid>', methods=['GET'])
def get_company(mid):
    detailTable = Table.query.filter_by(mid=mid).first()
    if detailTable:
        return jsonify(detailTable.to_dict()), 200
    else:
        return jsonify({'message': 'detailTable表没有数据'}), 404